export default{
    data() {
        return {
          options: {
            yesnoBool: [
              {
                name: "是",
                code: true,
              },
              {
                name: "否",
                code: false,
              },
            ],
            yesno: [
              {
                name: "是",
                code: 1,
              },
              {
                name: "否",
                code: 2,
              },
            ],
            whether: [
              {
                name: "是",
                code: 1,
              },
              {
                name: "否",
                code: 0,
              },
            ],
            recommend: [
              {
                name: "推荐",
                code: 1,
              },
              {
                name: "不推荐",
                code: 2,
              },
            ],
            publishStatus: [
              {
                name: "已发布",
                code: 1,
              },
              {
                name: "未发布",
                code: 2,
              },
            ],
            pushStatus: [
              {
                name: "已上架",
                code: 1,
              },
              {
                name: "未上架",
                code: 2,
              },
            ],
            approveStatus: [
              {
                name: "待审核",
                code: 0,
              },
              {
                name: "已审核",
                code: 1,
              },
              {
                name: "已驳回",
                code: 2,
              },
            ],
            // 跳转方式
            forwordWay: [
              {
                name: "内部",
                code: 1,
              },
              {
                name: "外部",
                code: 2,
              },
            ],
            // 跳转类型
            forwordType: [
              {
                name: "农产品",
                code: 1,
              },
              {
                name: "农事服务",
                code: 2,
              },
              {
                name: "内容管理",
                code: 3,
              },
              {
                name: "APP菜单",
                code: 4,
              },
              {
                name: "专题页",
                code: 5,
              },
            ],
            // 登录渠道
            channel: [
              {
                name: "PC",
                code: 1,
              },
              {
                name: "APP",
                code: 2,
              },
            ],
            // 操作类型
            operateType: [
              {
                name: "登录",
                code: 1,
              },
              {
                name: "登出",
                code: 2,
              },
            ],
            shipmentStatus: [
              {
                name: "已发货",
                code: 1,
              },
              {
                name: "未发货",
                code: 2,
              },
            ],
          },
        };
      },
      methods: {
        renderOption(value, field) {
            if (!this.options) {
              console.log("请配置mixins options");
              return false;
            }
      
            let statusText = "";
            this.options[field].map((item) => {
              if (item.code == value) {
                statusText = item.name;
              }
            });
      
            return statusText;
          }
      }


}
